<?
$navData = '
    <navigation>
        <Rollen link="/admin/roles/">
            <Anlegen link="/admin/roles/add" controller="roles" allowedRoles="adminstrator"/>
        </Rollen>
        <User link="/admin/users/">
            <Anlegen link="/admin/users/add" controller="users"/>
        </User>
        <Meldungen link="/manager/notices/">
            <Anlegen link="/manager/notices/add" controller="notices" allowedRoles="adminstrator"/>
        </Meldungen>
        <Unternehmen link="/manager/companies/">
            <Anlegen link="/manager/companies/add" controller="companies" />
        </Unternehmen>
        <Kontakt link="/manager/contactPersons/">
            <Anlegen link="/manager/contactPersons/add" controller="contactPersons"/>
        </Kontakt>
        <Studenten link="/manager/students/">
            <Anlegen link="/manager/students/add" controller="students" allowedRoles="adminstrator"/>
        </Studenten>
        <Kurse link="/manager/courses/">
            <Anlegen link="/manager/courses/add" controller="courses" allowedRoles="adminstrator"/>
        </Kurse>
        <Profile link="/manager/profiles/">
            <Anlegen link="/manager/profiles/add" controller="profiles" allowedRoles="adminstrator"/>
        </Profile>
        <Dozenten link="/manager/professors/">
            <Anlegen link="/manager/professors/add" controller="professors" allowedRoles="adminstrator"/>
        </Dozenten>
        <Studienrichtung link="/manager/studyBranches/">
            <Anlegen link="/manager/studyBranches/add" controller="studyBranches" allowedRoles="adminstrator"/>
        </Studienrichtung>
    </navigation>
';


$navData2 = '
<navigation>
  <menu name="Meldungen" link="/manager/notices/" controller="notices">
    <menu name="Meldungen Verwalten" link="/manager/notices/"/>
    <menu name="Meldungen Anlegen" link="/manager/notices/add"/>
  </menu>
  <menu name="Kurs" link="/manager/courses/" controller="courses,profiles,studyBranches">
    <menu name="Kurs Verwalten" link="/manager/courses/" />
    <menu name="Kurs Anlegen" link="/manager/courses/add" />
    <menu name="Profile Verwalten" link="/manager/profiles/" />
    <menu name="Profil Anlegen" link="/manager/profiles/add" />
    <menu name="Studienrichtungen Verwalten" link="/manager/studyBranches/" />
    <menu name="Studienrichtung Anlegen" link="/manager/studyBranches/add" />
  </menu>
  <menu name="Persona" link="/manager/students/add" controller="companies,contactPerson,students,professors">
    <menu name="Unternehmen Verwalten" link="/manager/companies/"/>
    <menu name="Unternehmen Anlegen" link="/manager/companies/add"/>
    <menu name="Kontakte Verwalten" link="/manager/contactPerson/"/>
    <menu name="Kontakt Anlegen" link="/manager/contactPersons/add"/>
    <menu name="Studenten Verwalten" link="/manager/students/"/>
    <menu name="Student Anlegen" link="/manager/students/add"/>
    <menu name="Dozenten Verwalten" link="/manager/professors/"/>
    <menu name="Dozent Anlegen" link="/manager/professors/add"/>
  </menu>
  <menu name="Admin" link="/admin/users/" controller="roles,users">
    <menu name="Rollen Verwalten" link="/admin/roles/"/>
    <menu name="Rollen Anlegen" link="/admin/roles/add"/>
    <menu name="User Verwalten" link="/admin/users/"/>
    <menu name="User Anlegen" link="/admin/users/add"/>
  </menu>
</navigation>
';


$xmlObj = new Xml($navData2);
$xmlArray = $xmlObj->toArray(); 
$xml = $xmlArray['Navigation'];

echo $this->Navigation->buildNavigation($xml);
?>
